package sol.leetcode;

/**
 * Excel Sheet Column Title
 * Created by lkk on 2016/8/28.
 */
public class Issue168 {
    public static String convertToTitle(int n) {
        String res = "";
        while (n != 0) {
            char tmp = (char) (n % 26 - 1 + 'A');
            n /= 26;
            res = tmp + res;
        }
        return res;
    }

    public static void main(String[] args) {
        System.out.println(convertToTitle(1));
    }
}
